A short description of the post.
pal <- colorFactor(
palette='Dark2',
domain=res_zones$density
)
pal_holc <- colorFactor(
palette=c("green","blue", "yellow", "red"),
domain=durham_lines$holc_grade
)
combined_map <- leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
setView(-78.90390102117877,35.998220055791876, zoom=14)%>%
addPolygons(data=res_zones,
group="Zoning",
weight=1,
color=~pal(density),
popup=paste("Zone Type: ", res_zones$zone_flag, "<br>",
"Detailed Zone:", res_zones$density, "<br>",
"Zoned for ", res_zones$dwell_units, "Dwell Units maximum", "<br>",
"Acres: ", res_zones$ACRES)) %>%
addPolygons(data=durham_lines,
group="HOLC",
weight=1,
color=~pal_holc(holc_grade),
popup=paste("HOLC Grade: ", durham_lines$holc_grade, "<br>")) %>%
addLegend(
position="bottomright",
group="Zoning",
pal=pal,
values=res_zones$density
) %>%
addLegend(
position="bottomright",
group="HOLC",
pal=pal_holc,
values=durham_lines$holc_grade
) %>%
addLayersControl(overlayGroups = c("Zoning", "HOLC"))
combined_map %>% hideGroup("Zoning")
Further analysis questions:
using centroid tagging, what is the proportion of Durham zones that are represented by HOLC letters? i.e. are 80% low density homes in A grade zones?
what about census population, census demograhpic + income characteristics?
working progress but very interesting.